Object Model


Libraries

The following function libraries are referenced by Declare statements.

kernel32.dll


References

FileName | Version | Size | Description
StdOle2.Tlb | 2.20.4118.1 | 16896 | OLE Automation
InnovaCOM.dll | 1.1.0.0 | 40960 | Innovasys COM Support Functionality
InnovaUtility.dll | 1.2.0.0 | 200704 | Innovasys General Utility Function Library


XMLDocument object

All code contained within this Visual Basic Project is Copyright
1998 Innovasys Limited

An XML document, consisting of a hierarchical set of elements.
Every XML document has a single root Element, providing access to all other elements

Each Element as a set of properties and zero or more child elements.

The document can be loaded and saved to / from a string using the Load
and Save methods

This document has been created in part to serve as an example of the output
produced by Document! VB. Refer to the links below to see specific examples

A Method returning a value
An Event
A Property returning a collection
A Method with an optional parameter
API calls to a particular library
A specific API call


Element object

An XML document element.

An element can may zero or more properties.

An element can optionally have text associated with it, which in the XML
representation appears between the opening and closing tags.


Property object

An element property. A property has a name and a value.

Each element property is unique within an element and is identified within the Properties
collection by it's name

Each element can have zero or more properties


Properties collection

Returns the collection of properties associated with this Element

Collection type

A Properties collection.

Syntax

[Set] object.Properties [= Properties]

The Properties property syntax has these parts:

Part | Description
object | An expression evaluating to an object of type Element.
Properties | A Properties collection


Children collection

Returns an Elements collection containing the elements appearing as
children of this element in the XML Document hierarchy

Collection type

An Elements collection.

Syntax

[Set] object.Children [= Elements]

The Children property syntax has these parts:

Part | Description
object | An expression evaluating to an object of type Element.
Elements | An Elements collection


Elements collection

A collection object containing a set of Element objects


Properties collection

A collection object containing a set of Property objects


Load method

Load an XML document from the passed XML string

Return Type

A Boolean value. Indicates success or failure of the load operation

Syntax

object.Load (Text)

The Load method syntax has these parts:

Part | Description
object | An expression evaluating to an object of type XMLDocument.
Text | Required. A String value. A valid XML string, containing a hierachical set of elements including a single root element


Save method

Return the currently loaded XML document as an XML string

Return Type

A String value. A valid XML string with a single Root element

Syntax

object.Save

The Save method syntax has these parts:

Part | Description
object | An expression evaluating to an object of type XMLDocument.


AddProperty method

Add a new property to this Element

Return Type

A Property object. A handle to the new Property object

Syntax

object.AddProperty (Name, Value)

The AddProperty method syntax has these parts:

Part | Description
object | An expression evaluating to an object of type Element.
Name | Required. A String value.
Value | Required. A String value.


AddChild method

Create a new child Element

Return Type

An Element object. A handle to the new Element

Syntax

object.AddChild (Name, Text)

The AddChild method syntax has these parts:

Part | Description
object | An expression evaluating to an object of type Element.
Name | Required. A String value.
Text | Required. A String value.


Add method (Elements)

Add a new Element object to the collection

Return Type

An Element object.

Syntax

object.Add (Element[, sKey])

The Add method syntax has these parts:

Part | Description
object | An expression evaluating to an object of type Elements.
Element | Required. An Element object.
sKey | Optional. A String value.


Remove method (Elements)

Remove the Element corresponding to the supplied key

Syntax

object.Remove Key

The Remove method syntax has these parts:

Part | Description
object | An expression evaluating to an object of type Elements.
Key | Required. A Variant value. A string or numeric representing the key or index of the required element of the collection


Add method (Properties)

Add a new Property object to the collection

Syntax

object.Add Property[, sKey]

The Add method syntax has these parts:

Part | Description
object | An expression evaluating to an object of type Properties.
Property | Required. A Property object.
sKey | Optional. A String value.


Remove method (Properties)

Remove the Element corresponding to the supplied key

Syntax

object.Remove vntIndexKey

The Remove method syntax has these parts:

Part | Description
object | An expression evaluating to an object of type Properties.
vntIndexKey | Required. A Variant value.


Root property

The root Element of the document. All document elements have an eventual parent of this element

Property type

An Element object.

Syntax

[Set] object.Root [= Element]

The Root property syntax has these parts:

Part | Description
object | An expression evaluating to an object of type XMLDocument.
Element | An Element object


Parent property

Returns an Element object which is the parent of this element in the
XML document hierarchy

Property type

An Element object.

Syntax

[Set] object.Parent [= Element]

The Parent property syntax has these parts:

Part | Description
object | An expression evaluating to an object of type Element.
Element | An Element object


Text property

The text in between the opening and closing tags of this XML element
in the XML document

Property type

A String value.

Syntax

object.Text [= value]

The Text property syntax has these parts:

Part | Description
object | An expression evaluating to an object of type Element.
value | A String value


Name property (Element)

The name of this XML element

Property type

A String value.

Syntax

object.Name [= value]

The Name property syntax has these parts:

Part | Description
object | An expression evaluating to an object of type Element.
value | A String value


Item property (Elements)

Return the Element object corresponding to the supplied Key

Property type

An Element object.

Syntax

[Set] object.Item(Key)

The Item property syntax has these parts:

Part | Description
object | An expression evaluating to an object of type Elements.
Key | Required. A Variant value. A string or numeric representing the key or index of the required Element of the collection


Count property (Elements)

Returns a count of the number of members in this collection

Property type

A Long value.

Syntax

object.Count

The Count property syntax has these parts:

Part | Description
object | An expression evaluating to an object of type Elements.


NewEnum property (Elements)

Property type

An IUnknown object.

Syntax

[Set] object.NewEnum

The NewEnum property syntax has these parts:

Part | Description
object | An expression evaluating to an object of type Elements.


Value property

Returns the value associated with this property object.

All properties are returned as string values

Property type

A String value.

Syntax

object.Value [= value]

The Value property syntax has these parts:

Part | Description
object | An expression evaluating to an object of type Property.
value | A String value


Name property (Property)

Returns the name of this property.

There is only ever one property with a given name within a single Element.

Property type

A String value.

Syntax

object.Name [= value]

The Name property syntax has these parts:

Part | Description
object | An expression evaluating to an object of type Property.
value | A String value


Item property (Properties)

Return the Element object corresponding to the supplied Key

Property type

A Property object.

Syntax

[Set] object.Item(vntIndexKey)

The Item property syntax has these parts:

Part | Description
object | An expression evaluating to an object of type Properties.
vntIndexKey | Required. A Variant value.


Count property (Properties)

Returns a count of the number of members in this collection

Property type

A Long value.

Syntax

object.Count

The Count property syntax has these parts:

Part | Description
object | An expression evaluating to an object of type Properties.


NewEnum property (Properties)

Property type

An IUnknown object.

Syntax

[Set] object.NewEnum

The NewEnum property syntax has these parts:

Part | Description
object | An expression evaluating to an object of type Properties.


DocumentLoaded event

This event indicates that the XML document has been fully loaded and is ready
for use

Syntax

Sub object_DocumentLoaded(FileName)

The DocumentLoaded event syntax has these parts:

Part | Description
object | A XMLDocument object.
FileName | A String value.


TagTypeEnum enumeration

Members

Constant | Description
ttNormal | A Normal Tag
ttComment | A Comment Tag


kernel32.dll library

kernel32.dll

The following function calls to this Library are declared.

Name | Alias | Description
OpenFile |  | This function is used to open and create files
WriteFile |  | This function is used to output to a file


OpenFile library function

This function is used to open and create files

Syntax

Return Type

A Long value.

Syntax

Function OpenFile(lpFileName, lpReOpenBuff, wStyle)

The OpenFile library function syntax has these parts:

Part | Description
lpFileName | Required. A String value.
lpReOpenBuff | Required. An OFSTRUCT object.
wStyle | Required. A Long value.


WriteFile library function

This function is used to output to a file

Syntax

Return Type

A Long value.

Syntax

Function WriteFile(hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesWritten, lpOverlapped)

The WriteFile library function syntax has these parts:

Part | Description
hFile | Required. A Long value.
lpBuffer | Required. A value of Any type.
nNumberOfBytesToWrite | Required. A Long value.
lpNumberOfBytesWritten | Required. A Long value.
lpOverlapped | Required. An OVERLAPPED object.